import 'dart:async';
import 'package:flutter/services.dart';

class Setup {
  static const String UserToken = 'app.UserToken.123213';
  static const EventChannel _eventChannel = EventChannel('app_event');
  //监听 native event 数据流
  static void onListenStreamData(onEvent, onError) {
    _eventChannel.receiveBroadcastStream().listen(onEvent, onError: onError);
  }

  static void onEvent(e) {
    print('onEvent$e');
  }

  static void onError(e) {
    print('onError$e');
  }
}
